package com.xyy.saas.payment.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;

public enum OpenAccountReportStatusEnum {
    //商户总数
    //未提交开户资料商户
    //开富民基本户成功商户
    //平安换签成功商户
    SUM_CORPORATION ("SUM_CORPORATION","商户总数"),
    SUM_CORPORATION_FOR_NO_TDATA ("SUM_CORPORATION_FOR_NO_TDATA","未提交开户资料商户"),
    SUM_CORPORATION_FOR_FM_BASE_ACCOUNT_SUCCESS ("SUM_CORPORATION_FOR_FM_BASE_ACCOUNT_SUCCESS","开富民基本户成功商户"),
    SUM_CORPORATION_FOR_PINGAN_BASE_ACCOUNT_SUCCESS ("SUM_CORPORATION_FOR_PINGAN_BASE_ACCOUNT_SUCCESS","平安换签成功商户");
    private String code;
    private String desc;

    private static Map<String, OpenAccountReportStatusEnum> code2Enum;

    static {
        code2Enum = Arrays.asList(values()).stream().collect(Collectors.toMap(OpenAccountReportStatusEnum::getCode, UnaryOperator.identity()));
    }

    public static OpenAccountReportStatusEnum getEnum(String code){
        return code2Enum.get(code);
    }

    OpenAccountReportStatusEnum(String code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
